import request from '@/utils/request'
import { remoteRequest } from '@/utils/remote'
import axios from "axios";

// 查询重点场所风险评估列表
export function listEmphasis(id) {
  return request({
    url: '/fxfzaqbz/data/getKeyplaceRiskassessmentByActiveId/' + id,
    method: 'get',
  })
}

export function listEmphasiss(id) {
  return request({
    url: '/fxfzaqbz/data/getKeyplaceRiskassessmentByIaId/' + id,
    method: 'get',
  })
}

// 查询重点场所风险评估详细
export function getEmphasis(id) {
  return request({
    url: '/fxfzaqbz/data/getKeyplaceRiskassessmentById?id=' + id,
    method: 'get'
  })
}

// 上传重点场所风险评估
export function uploadEmphasis(data) {
  return request({
    url: '/fxfzaqbz/data/saveKeyplaceRiskassessment',
    method: 'post',
    data: data
  })
}

// 修改重点场所风险评估
export function updateEmphasis(data) {
  return request({
    url: '/fxfzaqbz/data/updateKeyplaceRiskassessment',
    method: 'post',
    data: data
  })
}

// 删除重点场所风险评估
export function delEmphasis(id) {
  return request({
    url: '/fxfzaqbz/data/delKeyplaceRiskassessment?id=' + id,
    method: 'post'
  })
}

// 提交最终成果
export function firstSubmitDisasterAss(id) {
  return request({
    url: '/fxfzaqbz/data/submitResultKeyplaceRiskassessment?id=' + id,
    method: 'post',
  })
}

// 标题是否重复
export function titleCheck(data) {
  return remoteRequest('titleCheck', data, () => {
    return request({
      url: '/fxfzaqbz/data/checkKeyplaceRiskassessment',
      method: 'post',
      data: data
    })
  })
}

// 编辑描述
export function updataDescribe(data) {
  return request({
    url: '/fxfzaqbz/data/saveDescriptionKeyplaceRiskassessment',
    method: 'post',
    data: data
  })
}

// 移除数据
export function removeDisasterAss(id) {
  return request({
    url: '/fxfzaqbz/data/removeResultKeyplaceRiskassessment?id=' + id,
    method: 'post',
  })
}

// 提交
export function secondSubmitDisasterAss(ids) {
  return request({
    url: '/fxfzaqbz/data/finalSubmissionKeyplaceRiskassessment/' + ids,
    method: 'post',
  })
}

// 重点场所风险评估一键出图生成应急疏散辅助决策图
export function assessEmphasisNetworkPath(data) {
  return request({
    url: `/fxfzaqbz/data/assessEmphasisNetworkPath`,
    method: 'post',
    data: data
  })
}

// 地震应急疏散辅助决策图-图件模板
export function getTypeNameByType(type) {
  return request({
    url: `/map/getTypeNameByType/${type}`,
    method: 'get'
  })
}